#include <iostream>
#include<iomanip>
using namespace std;
struct book
{
    string isbn;
    string name;
    float price=0;

};
struct line
{
    int num;
    struct book* ele;
};

float avg(book *ele, int length)
{
    float avg;
    float sum = 0;
    for (int n = 0; n < length; n++)
    {
        sum += ele[n].price;
    }
    avg = sum / length;
    return avg;
}

void findmax(book* ele, int n)
{
    int max = 0, num=0;
    for(int i = 0; i < n; i++)
    {
        if (ele[i].price > max)
        {
            max = ele[i].price;
        }
    }
    for (int j = 0; j < n; j++)
    {
        if (ele[j].price == max)
        {
            num++;
            cout << ele[j].isbn << " " << ele[j].name << " ";
            cout << fixed << setprecision(2) << ele[j].price << endl;
        }
    }
    cout << num<<endl;
}

int insert(book* ele, int n)
{
    int loc;
    string isbn;
    string name;
    float price;
    cin >> loc;
    cin >> isbn >> name >> price;
    if (loc < n)
    {
        for(int i = n; i >loc-1; i--)
        {
            ele[i] = ele[i - 1];          
        }
        ele[loc - 1].isbn = isbn;
        ele[loc - 1].name = name;
        ele[loc - 1].price = price;
    }
    else if(loc==n){
        ele[loc].isbn = isbn;
        ele[loc].name = name;
        ele[loc].price = price;
    }
    else
    {
        cout << "抱歉，入库位置非法!";
    }
    return ++n;
}



int main()
{
    
    int n = 0;
    float avg1=0;
    string isbn;
    string name;
    float price=0;
    line stu;
    stu.ele = new book[100];
    while (1)
    {   cin >> isbn>>name>>price;
        if (isbn == "0" && name == "0" && price == 0)
        {
            break;
        }
        stu.ele[n].isbn=isbn;
        stu.ele[n].name = name;
        stu.ele[n].price = price;
        n++;

    }

    stu.num = insert(stu.ele, n);
   // avg1=  avg(stu.ele, n);
    //cout <<fixed<<setprecision(2)<< avg1<<endl;
    cout << stu.num<<endl;
    for (int i = 0; i < stu.num; i++)
    {
       /*if (stu.ele[i].price < avg1)
        {
            stu.ele[i].price *= 1.2;
        }
        else {
            stu.ele[i].price *= 1.1;
        }*/
        cout << stu.ele[i].isbn << " " << stu.ele[i].name << " ";
        cout<<fixed<<setprecision(2)<< stu.ele[i].price<<endl;
        
    
    }
    //findmax(stu.ele, n);
    
}

